home *** CD-ROM | disk | FTP | other *** search
- /* asctime.c Turbo C Bible functions, p. 328 */
- #include <stdio.h>
- #include <time.h>
- main()
- {
- struct tm *curtime;
- time_t bintime;
- time(&bintime); /* Get time in seconds sin 00:00:00 GMT, 1/1/70 */
- curtime = localtime(&bintime);
- /* Convert time to local time (default is PST) */
- printf("Current time: %s\n", asctime(curtime));
- /* Use asctime to print the date and time */
- }